package com.mybook.app.mapper;

import com.mybook.app.core.CommonMapper;
import com.mybook.app.dto.BookInfoAndUserInfoDto;
import com.mybook.app.model.BookInfo;
import com.mybook.app.request.BookDiscoverRequest;
import com.mybook.app.request.ShareListRequest;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BookInfoMapper extends CommonMapper<BookInfo> {
    BookInfoAndUserInfoDto findBookInfoByIdWithUserInfo(@Param("id") String id);

    List<BookInfoAndUserInfoDto> findBookInfoByKeywordAndNearAndOrderAndSexAndPage(BookDiscoverRequest bookDiscoverRequest);

    List<BookInfo> findBookInfoByOcId(ShareListRequest shareListRequest);

    Integer updateBookInfoFlagByBid(@Param("id") String id);

    BookInfo findBookInfoById(@Param("id") String id);

    Integer updateBookInfoCuIdByBid(@Param("id") String id, @Param("userId") String userId);

    Integer updateBookInfoBorrowsByBid(@Param("id") String id);

    Integer updateBookInfoBorrowStatusByBid(@Param("borrowStatus") Integer borrowStatus, @Param("id") String id);


}